export async function getItem(key: string): Promise<Blob | undefined> {
    let realKey = key.split("?")[0].split("//")[2];
    let res = localStorage.getItem(realKey);
    if (!res) {
        await fetch(key)
            .then(async resp => {
                (await resp.blob()).text()
                .then(str => {
                    localStorage.setItem(realKey, str);
                    res = localStorage.getItem(realKey)!;
                })
                .catch(err => {
                    console.error(err)
                })

            })
    }
    return new Blob([new TextEncoder().encode(res!)]);
}
